if the short name of this card is not "Instruction" then
put "Card no." && max(1,the number of this cd - 14) && "of" && the number of cds - 14 into bg fld "Status"
setButtonOutlines
end if
pass openCard
end openCard
on newBackground type,makeNew
lock screen
push cd
go next cd of bg type
if makeNew then doMenu "New Card"
unlock screen
if makeNew then tabKey
end newBackground
on showComments
lock screen
show bg btn "Comments"
show bg btn "commentsGoAway"
show bg fld "comments"
unlock screen with barn door open
select before text of bg fld "comments"
end showComments
on hideComments
if the visible of bg fld "comments" then
lock screen
hide bg fld "comments"
hide bg btn "Comments"
hide bg btn "commentsGoAway"
unlock screen with barn door close
end if
end hideComments
on showOtherFields
lock screen
show bg btn "Other Fields"
show bg btn "otherFieldsGoAway"
show bg fld "otherFields"
unlock screen with barn door open
select before text of bg fld "otherFields"
end showOtherFields
on hideOtherFields
if the visible of bg fld "otherFields" then
lock screen
hide bg fld "otherFields"
hide bg btn "Other Fields"
hide bg btn "otherFieldsGoAway"
unlock screen with barn door close
end if
end hideOtherFields
on CheckRequired stop
global dontCheckFields
if dontCheckFields then exit CheckRequired
if bg fld 1 is not empty and bg fld "otherFields" is empty then
repeat with i=2 to stop
if bg fld i is empty then
beep
answer "You should fill in all the required fields." with "OK"
exit CheckRequired
end if
end repeat
end if
end CheckRequired
on setButtonOutlines
if bg fld "Comments" is not empty
then set the style of bg button "Show Comments" to rectangle
else set the style of bg button "Show Comments" to shadow
if bg fld "otherFields" is not empty
then set the style of bg button "Other Fields…" to rectangle
else set the style of bg button "Other Fields…" to shadow
end setButtonOutlines
on NewItem self
put the cmdKey is up and the optionKey is up and the shiftKey is up into makeNew
if makeNew
then put "(Add New:" into title
else put "(Go to Next:" into title
get PopUpMenu(self, title&",Article,Book,Booklet,InBook,InCollection", "InProceedings,Manual,MastersThesis,Misc,PhDThesis", "Proceedings,TechReport,Unpublished")
if item 1 of it is empty then exit NewItem
NewBackground (item 1 of it),makeNew
end NewItem
on ChangeStyle myStyle
lock screen
get PopUpMenu(myStyle, "(Convert To:,Article,Book,Booklet,InBook,InCollection", "InProceedings,Manual,MastersThesis,Misc,PhDThesis", "Proceedings,TechReport,Unpublished")
if item 1 of it is empty or item 2 of it is myStyle then exit ChangeStyle